//
//  NextPageCell.m
//  sdtv
//
//  Created by intel intel on 11-10-31.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import "NextPageCell.h"

@implementation NextPageCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleGray;
        self.backgroundColor = [UIColor grayColor];
        UILabel *text = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
        text.tag = 200;
        [text setFont:[UIFont boldSystemFontOfSize:14]];
        text.text = @"More...";
        text.textAlignment = UITextAlignmentCenter;
        [text setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:text];
        //[text release];
        
        UIActivityIndicatorView *view = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
        view.frame = CGRectMake(200, 10, 20.0f, 20.0f);
        view.tag = 300;
        [self.contentView addSubview:view];
        //[view release];
    }
    return self;
}


-(void)start
{
	UIActivityIndicatorView *view = (UIActivityIndicatorView*)[self.contentView viewWithTag:300];
	if (view && [view isKindOfClass:UIActivityIndicatorView.class]) {
		[view startAnimating];
		UILabel *text =  (UILabel*)[self.contentView viewWithTag:200];
		text.text = @"Loading...";
	}
}


-(void)over
{
	UIActivityIndicatorView *view = (UIActivityIndicatorView*)[self.contentView viewWithTag:300];
	if (view && [view isKindOfClass:UIActivityIndicatorView.class]) {
		[view stopAnimating];
		UILabel *text =  (UILabel*)[self.contentView viewWithTag:200];
		text.text = @"More...";
	}
}


@end
